Skip to main content

IsRespectBorders

Checks if the form border width is respected or not.

Syntax

expression.IsRespectBorders();

expression - A variable that represents a ApiPictureForm class.

Parameters

This method doesn't have any parameters.

Returns

boolean

Example

This example checks if the form border width is respected or not.

let doc = Api.GetDocument();
let pictureForm = Api.CreatePictureForm({"key": "Personal information", "tip": "Upload your photo", "required": true, "placeholder": "Photo", "scaleFlag": "tooBig", "lockAspectRatio": true, "shiftX": 50, "shiftY": 50});
let paragraph = doc.GetElement(0);
paragraph.AddElement(pictureForm);
pictureForm.SetImage("https://api.onlyoffice.com/content/img/docbuilder/examples/user-profile.png");
pictureForm.SetRespectBorders(true);
let respectBorders = pictureForm.IsRespectBorders();
paragraph = Api.CreateParagraph();
paragraph.AddText("The borders of the first picture form in this document are respected when scaling the image: " + respectBorders);
doc.Push(paragraph);